package com.dao;

import java.io.*;
import java.sql.SQLException;
import java.util.*;

import javax.swing.plaf.synth.SynthSeparatorUI;

import org.apache.tomcat.util.collections.SynchronizedStack;

import com.bean.*;

import javafx.scene.control.Alert;

public class Testj extends D{
//public static void main(String[] args) throws IOException {
//	UserDao uid=new UserDao();
//	User ui=uid.findUser("哈jian");
//	System.out.println(ui);
//	ui.setName("哈lon");
//	uid.updateUser(ui);
//	System.out.println(ui.getName());
	
//	DataDao uid=new DataDao("Composition");
//	Composition ui=(Composition) uid.find("大米");
//	System.out.println(ui);
//	ui.setName("makalong");
//	//uid.add(ui);
//	System.out.println(ui.getName());
//	DataDao userDao=new DataDao("User");
//	@SuppressWarnings("unchecked")
//	List<User> users=userDao.findAll();
//	System.out.println(users.size());
//	
//	System.out.println(users.get(0).getName());
	StringBuilder sb=null;
public static void main(String[] args) {
	Testj[] td=new Testj[3];
	D []d=td;
	D []k=new D[3];
	//t=(Testj[]) k;
	double ou=11/0.0;
	System.out.println(ou*0-999);
	D lk=new D();
System.out.println(lk.pp());
for(String ar:args)
	System.out.println(ar);
StringBuilder buf=new StringBuilder("");
Testj t=new Testj();

for(int i=0;i<20;i++)
new Thread(new Runnable(){
	public void run(){
		for(int i=0;i<222;i++)
		t.talk(new StringBuilder(""));
	}
}).start();;

}
 void talk(StringBuilder str){
	sb=str.append(Thread.currentThread().getName());
	try {
		Thread.sleep(10);
	} catch (InterruptedException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	System.out.println(Thread.currentThread().getName());
	Thread.yield();
	
	System.out.println(Thread.currentThread().getName()+sb);
	assert(!Thread.currentThread().getName().toString().equals(sb.toString())):Thread.currentThread().getName();
}
}


class D{
	static StringBuilder i=new StringBuilder("aaa");
	D(){
		
	}
	static StringBuilder pp(){
		try{
			return i;
		}finally{
			i=new StringBuilder("kldjfs");
		}
	}
}